Batch deletion method and apparatus for cache contents, device and readable storage medium

ABSTRACT

A batch deletion method, apparatus, and device for cached content and a non-transitory computer-readable storage medium are disclosed. The method may include: adding keywords to content identifiers which correspond to cached resources (S101); saving the content identifiers separately (S102); finding, through a keyword-based query, content identifiers meeting at least one condition (S103); locating storage paths of cached resources by using the content identifiers meeting the at least one condition (S104); and deleting the located cached resources one by one (S105).

CROSS-REFERENCE TO RELATED APPLICATION

This application is a national stage filing under 35 U.S.C. § 371 ofinternational application number PCT/CN2020/122504, filed on Oct. 21,2020, which claims priority to Chinese patent application No.201911033721.1 filed on Oct. 28, 2019. The contents of theseapplications are incorporated herein by reference in their entirety.

TECHNICAL FIELD

Embodiments of the present disclosure relate to but are not limited tothe field of content delivery network (CDN) application for theInternet, and in particular, relate to but are not limited to a batchdeletion method, apparatus, and device for cached content and anon-transitory computer-readable storage medium.

BACKGROUND

During operation and maintenance for a CDN, batch deletion of cachedcontent is required in some scenarios, which are specifically describedas follows. Scenario One: A cooperative content provider (CP) requiresbatch removal of content from both the CDN and its source site, forexample, all resources for a specific video website, Hong Kong andTaiwan movie resources in a movie category for a specific video website,and resources launched on Jun. 5, 2019 for a specific video website.Scenario Two: To achieve economic benefits and improve resourceutilization, the CDN is expected to cache high-value and popular contentand clear less popular content in batches to free up disk space.Scenario Three: For social benefits, batch deletion of sensitive orunsafe and risky resources is required during major national conferencesor important holidays.

A CDN server constructed based on NGINX, as shown in FIG. 6 , supportsonly a narrow range of content deletion functions and does not supporttimely batch deletion of content with some common characteristics. Thismakes it difficult to implement deletion in some scenarios. In thesescenarios, it is often necessary to obtain accurate and complete uniformresource locators (URL) in order to delete corresponding resources,which is inefficient. If a platform includes sensitive or unsaferesources, a server disk has to be formatted and thus all content has tobe re-cached, causing a serious waste of resources. For theabove-mentioned problems in some cases, it's important to propose aCDN-applicable batch deletion method for cached content which enablesdeletion of specified content and batch deletion.

SUMMARY

The embodiments of the present disclosure provide a batch deletionmethod, apparatus, and device for cached content, and a non-transitorycomputer-readable storage medium to solve the following technicalproblems at least to a certain extent: in some cases, a CDN serverconstructed based on NGINX supports only a narrow range of contentdeletion functions and does not support timely batch deletion of contentwith some common characteristics, and consequently, efficiency isextremely low when batch deletion is required; and in some cases, if aplatform includes sensitive or unsafe resources, a server disk has to beformatted and thus all content has to be re-cached, causing a waste ofresources.

In view of this, an embodiment of the present disclosure provides abatch deletion method for cached resources, which may include: addingkeywords to content identifiers which correspond to cached resources;saving the content identifiers separately; finding, through akeyword-based query, content identifiers meeting at least one condition;locating paths of cached resources by using the content identifiersmeeting the at least one condition; and deleting the located cachedresources one by one.

An embodiment of the present disclosure further provides a batchdeletion apparatus for cached resources, which may include: a filestorage module configured to store cached resources; a content cachingmodule configured to add keywords to content identifiers whichcorrespond to the cached resources; a content identifier storage moduleconfigured to save the content identifiers separately; a contentidentifier batch search module configured to find, through akeyword-based query, content identifiers meeting at least one condition,and locate paths of cached resources by using the content identifiersmeeting the at least one condition; and a content deletion moduleconfigured to delete the located cached resources one by one.

An embodiment of the present disclosure further provides a batchdeletion device for cached resources, which may include a processor, amemory, and a communication bus, where the communication bus isconfigured to connect a first processor and a first memory; and theprocessor is configured to execute one or more computer programs storedin the memory to implement steps of the batch deletion method for cachedresources in any above embodiment.

An embodiment of the present disclosure further provides anon-transitory computer-readable storage medium storing one or morecomputer programs executable by one or more processors to implementsteps of the batch deletion method for cached resources in any aboveembodiment.

Other features and corresponding beneficial effects of the presentdisclosure are explained in the subsequent description, and it should beunderstood that at least some of the beneficial effects become apparentfrom the description of the present disclosure.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a flowchart of a batch deletion method for cached resources inexample embodiment I of the present disclosure;

FIG. 2 is a flowchart of a batch deletion method for cached resources ina process of outdated content and single content deletion in exampleembodiment II of the present disclosure;

FIG. 3 is a flowchart of a batch deletion method for specific content inexample embodiment III of the present disclosure;

FIG. 4 is a schematic diagram of a batch deletion apparatus for cachedresources in example embodiment IV of the present disclosure;

FIG. 5 is an execution flowchart for functional modules in the batchdeletion apparatus for cached resources in example embodiment IV of thepresent disclosure; and

FIG. 6 is a schematic diagram of a batch deletion device for cachedresources in example embodiment V of the present disclosure.

DETAILED DESCRIPTION

In order to make the objective, technical schemes and advantages of thepresent disclosure more clearly understood, the embodiments of thepresent disclosure will be further illustrated in detail by means ofspecific embodiments in conjunction with the accompanying drawings. Itshould be understood that the specific embodiments described here areintended only to explain the present disclosure and are not intended tolimit the present disclosure.

Example Embodiment I

This embodiment is intended to at least solve the following problems toa certain extent: in some cases, a CDN server constructed based on NGINXsupports only a narrow range of content deletion functions and does notsupport timely batch deletion of content with some commoncharacteristics, and consequently, efficiency is extremely low whenbatch deletion is required; and in some cases, if a platform includessensitive or unsafe resources, a server disk has to be formatted andthus all content has to be re-cached, causing a waste of resources. Thisembodiment provides a batch deletion method for cached resources, asshown in FIG. 1 , including the following steps.

At S101, keywords are added to content identifiers which correspond tocached resources.

In this step, each cached resource has its corresponding contentidentifier which includes a unique identifier corresponding to thecached resource. The unique identifier is a file name or an identifierwith a uniform resource identifier (URI) part of a parameter removed andusing a filekey part. For example, for the parameter:https://www.baidu.com/qq_32595453/article/details/79516787, a URI partis removed and the remaining part,/qq_32595453/article/details/79516787, is a unique identifier of theresource.

Keywords are added to the content identifiers to form contentidentifiers in specific formats. Keywords include a CP, a domain name ofthe CP, a column, a time, a web site risk level, cached resourcepopularity, and the like. The content identifiers include at least oneof the above keywords. There are two classification manners: staticclassification and dynamic classification that are performed accordingto types of the keywords.

Static classification includes the following types:

(1) Classification by the CP: A belonging CP can be identified byaccessing a domain name. This classification can cover all resourcesunder the CP. An identifier of the CP is added to the content identifierduring caching.

(2) Classification by the domain name of the CP: Generally, a large CPhas multiple domain names used to distinguish between differentservices. The domain name is added to the content identifier duringcaching.

(3) Classification by column: This classification is mainly performedwith reference to column categorization on a current website, forexample, TV series, movies and other large columns on a video website,as well as segmented columns under the large column, for example, HongKong and Taiwan movies, mainland China movies, and European and Americanmovies under the movie column. A column identifier is added to thecontent identifier during caching.

(4) Classification by time: Identification is realized by using aresource launch time in a resource URL. This classification depends ontime information, for example, time information in a video URL, includedin the URL in a website resource. The resource launch time informationor the like is added to the content identifier during caching.

Dynamic classification includes the following types:

(1) Classification by the website risk level: First, classification isperformed according to an IP home area of a source site. For example, awebsite in a disturbed area or a foreign website has a relatively highrisk level, and is classified into high-risk websites. The IP home areacan be obtained from a global IP address database. Classification isthen performed according to a type of a website. For example, a websitewith website information not existing in an ICP filing website isclassified into high-risk websites. The website information can beobtained by HTTP message interaction. The information is dynamicallyobtained and updated regularly during an actual retrieval process, andfinally a risk identifier is given to each cached content.

Optionally, website levels may alternatively be identified andclassified by manually adding risk levels.

Optionally, risk levels of the website are divided into five levels,with level 5 being the highest risk level and level 1 being the lowestrisk level.

(2) Classification by popularity: Statistics are collected forpopularity of the cached resources. For example, the cached resourcesare classified into resources with three-day popularity, weeklypopularity, and biweekly popularity. If corresponding duration is notreached for a resource, there is no statistical value for the resource.As a popularity value is updated in real time, a popularity value in thecontent identifier is also updated in real time.

Optionally, popularity values for the cached resources are divided intofive levels, level 5 being the most popular and level 1 being the mostunpopular. A correspondence relationship between a level and a resourceaccess frequency may also be manually configured.

At S102, the content identifiers are saved separately.

In this step, specifically, the content identifiers may be savedseparately from the cached resources. A format of the content identifieris as follows: CPHdomain name of the CP∥column∥time∥website risklevel∥cached resource popularity. For example, in the following formatcpid=xxvideo∥domain=xx.com∥column=movie∥time=2019/1/2∥filekey=/abc/123/xxx.mp4∥alarm=1∥hotrate=5, cpid represents the CP, domain represents a domain nameof the CP; column represents a column; time represents a time, which isspecifically a resource launch time; filekey represents a uniqueidentifier of the cached resource; alarm represents a risk level of asource website for the resource; and hotrate represents popularity ofthe resource. The example content identifier represents a cachedresource from the xx video supplier, with the domain name of xx.com, thecolumn of movies, the launch time of Jan. 2, 2019, the unique resourceidentifier of/abc/123/xxx.mp4, the risk level of 1, and resourcepopularity of level 5.

At S103, content identifiers meeting at least one condition are foundthrough a keyword-based query.

In this step, specifically, the parts, meeting at least one condition,of the separately stored content identifiers may be found through akeyword-based query after the keyword(s) is/are obtained. It should beunderstood that a keyword-based query may refer to a query for contentidentifiers matching only one specific keyword, or a query based on aplurality of keywords combined to obtain content identifiers meeting acombination of conditions.

At S104, storage paths of cached resources are located by using thecontent identifiers meeting the at least one condition.

In this step, specifically, the storage path of a cached resource may belocated according to partial data of the content identifier. Duringcaching resources, md5 is calculated by using the content identifierfrom which alarm and hotrate parts are removed, and a path of the cachedresource is planned according to an md5 value. The path of the cachedresource is planned according to the md5 value, which ensures uniquenessof the path of the cached resource, and also enables the contentidentifier to have a function of obtaining a location of the cachedresource.

At S105, the located cached resources are deleted one by one.

In this step, specifically, the located cached resources may besingle-deleted recursively until all the located cached resources aredeleted. The CDN server constructed based on NGINX supports singlecontent deletion, so the single content deletion method can be invokedrecursively to realize batch deletion of the located cached resources.

After deleting the located cached resources, the content identifierswhich correspond to the deleted cached resources are also deleted.

This embodiment has provided a batch deletion method for cachedresources, including adding keywords to content identifiers whichcorrespond to the cached resources and saving the content identifiersseparately; when it is necessary to delete particular cached resources,finding, through a keyword-based query, content identifiers meeting atleast one condition; and locating storage paths of cached resources byusing the content identifiers meeting the at least one condition, anddeleting the cached resources one by one by recursively invoking thesingle content deletion method. The batch deletion method for cachedresources is intended to at least solve the following problems to acertain extent: in some cases, the CDN server constructed based on NGINXsupports only a narrow range of content deletion functions and does notsupport timely batch deletion of content with some commoncharacteristics, and consequently, efficiency is extremely low whenbatch deletion is required; and in some cases, if the platform includessensitive or unsafe resources, a server disk has to be formatted andthus all content has to be re-cached, causing a waste of resources. Themethod realizes batch deletion of cached content in the CDN server withcustomized deletion conditions.

Example Embodiment II

This embodiment is intended to at least solve the following problems toa certain extent: in some cases, a CDN server constructed based on NGINXsupports only a narrow range of content deletion functions and does notsupport timely batch deletion of content with some commoncharacteristics, and consequently, efficiency is extremely low whenbatch deletion is required; and in some cases, if a platform includessensitive or unsafe resources, a server disk has to be formatted andthus all content has to be re-cached, causing a waste of resources. Thisembodiment provides a batch deletion method for cached resources. Tobetter understand the content of this embodiment, a batch deletionmethod for cached resources in a process of outdated content and singlecontent deletion is used as an example herein for illustration. As shownin FIG. 2 , the method includes the following steps:

At S201, a content deletion instruction including content informationrequiring single deletion or outdated content information is sent.

In this step, a unique identifier of a cached resource that needs to bedeleted may be set in the instruction to match the corresponding cachedresource.

At S202, a regular expression is used to find a matched contentidentifier after a delete message is received.

At S203, a path of a cached file is determined according to the foundcontent identifier and the cached file is deleted.

In this step, specifically, the storage path of a cached resource may belocated according to partial data of the content identifier. Duringcaching resources, md5 is calculated by using the content identifierfrom which alarm and hotrate parts are removed, and a path of the cachedresource is planned according to an md5 value. The path of the cachedresource is planned according to the md5 value, which ensures uniquenessof the path of the cached resource, and also enables the contentidentifier to have a function of obtaining a location of the cachedresource.

At S204, corresponding content identifiers saved in a memory and a diskare cleared.

This embodiment has provided a batch deletion method for cachedresources. When specified cached resources need to be deleted, contentidentifiers meeting at least one condition are found through akeyword-based query; storage paths of cached resources are located byusing the content identifiers meeting the at least one condition; andthe located cached resources are deleted. This realizes customizeddeletion of cached content in the CDN server and improves deletionefficiency.

Example Embodiment III

This embodiment is intended to at least solve the following problems toa certain extent: in some cases, a CDN server constructed based on NGINXsupports only a narrow range of content deletion functions and does notsupport timely batch deletion of content with some commoncharacteristics, and consequently, efficiency is extremely low whenbatch deletion is required; and in some cases, if a platform includessensitive or unsafe resources, a server disk has to be formatted andthus all content has to be re-cached, causing a waste of resources. Thisembodiment provides a batch deletion method for cached resources. Tobetter understand the content of this embodiment, a batch deletionmethod for specific content is used as an example herein forillustration. As shown in FIG. 3 , the method includes the followingsteps:

At S301, a content deletion instruction of a batch deletion type issent.

In this step, batch deletion of different content corresponds todifferent matching rules. For example, during batch deletion of cachedresources with a popularity level of 1, a matching rule is {circumflexover ( )}.*\|\|hotrate=1$; during batch deletion of cached resourceswith a risk level of 5, a matching rule is {circumflex over( )}.*\|\|alarm=5\|\|*$.

At S302, a regular expression is used to find a matched contentidentifier after a delete message is received.

At S303, cached files in a file system are deleted recursively accordingto the found group of content identifiers.

In this step, specifically, storage paths of cached resources may belocated by using corresponding data of the content identifiers accordingto the matching rule in the instruction. During caching resources, md5is calculated by using the content identifier from which alarm andhotrate parts are removed, and a path of the cached resource is plannedaccording to an md5 value. The path of the cached resource is plannedaccording to the md5 value, which ensures uniqueness of the path of thecached resource, and also enables the content identifier to have afunction of obtaining a location of the cached resource.

After the cached resource is located, the located cached resources aresingle-deleted recursively until all the located cached resources aredeleted. The CDN server constructed based on NGINX supports singlecontent deletion, so the single content deletion method can be invokedrecursively to realize batch deletion of the located cached resources.

At S304, content identifier entries saved in a memory and a disk arecleared.

In this step, each time one cached resource is deleted, itscorresponding content identifier is deleted.

At S305, all deletion is completed.

This embodiment has provided a batch deletion method for cachedresources. When specified cached resources need to be deleted, a batchdeletion instruction including matching rules is sent. The regularexpression is used to find matched content identifiers, and the storagepaths of cached resources are located by using the matched contentidentifiers. Then the located cached resources are single-deletedrecursively. The method realizes batch deletion of cached content in theCDN server with customized deletion conditions.

Example Embodiment IV

This embodiment is intended to at least solve the following problems toa certain extent: in some cases, a CDN server constructed based on NGINXsupports only a narrow range of content deletion functions and does notsupport timely batch deletion of content with some commoncharacteristics, and consequently, efficiency is extremely low whenbatch deletion is required; and in some cases, if a platform includessensitive or unsafe resources, a server disk has to be formatted andthus all content has to be re-cached, causing a waste of resources. Thisembodiment provides a batch deletion apparatus for cached resources, asshown in FIG. 4 , including a file storage module 41, a content cachingmodule 42, a content identifier storage module 43, a content identifierbatch search module 44, and a content deletion module 45. A flowchart offunction execution of the modules is shown in FIG. 5 .

The file storage module 41 is configured to store cached resources.

The content caching module 42 is configured to add keywords to contentidentifiers which correspond to the cached resources.

The cached resources each have its corresponding content identifier, andthe content identifier includes a unique identifier corresponding to thecached resource. The unique identifier is a file name or an identifierwith a URI part of a parameter removed and using a filekey part. Forexample, for the parameter:https://www.baidu.com/qq_32595453/article/details/79516787, a URI partis removed and the remaining part,/qq_32595453/article/details/79516787, is a unique identifier of theresource.

Keywords are added to the content identifiers to form contentidentifiers in specific formats. Keywords include a CP, a domain name ofthe CP, a column, a time, a website risk level, cached resourcepopularity, and the like. The content identifiers include at least oneof the above keywords. There are two classification manners: staticclassification and dynamic classification that are performed accordingto types of the keywords.

Static classification includes the following types:

(1) Classification by the CP: A belonging CP can be identified byaccessing a domain name. This classification can cover all resourcesunder the CP. An identifier of the CP is added to the content identifierduring caching.

(2) Classification by the domain name of the CP: Generally, a large CPhas multiple domain names used to distinguish between differentservices. The domain name is added to the content identifier duringcaching.

(3) Classification by column: This classification is mainly performedwith reference to column categorization on a current website, forexample, TV series, movies and other large columns on a video website,as well as segmented columns under the large column, for example, HongKong and Taiwan movies, mainland China movies, and European and Americanmovies under the movie column. A column identifier is added to thecontent identifier during caching.

(4) Classification by time: Identification is realized by using aresource launch time in a resource URL. This classification depends ontime information, for example, time information in a video URL, includedin the URL in a website resource. The resource launch time informationor the like is added to the content identifier during caching.

Dynamic classification includes the following types:

(1) Classification by the website risk level: First, classification isperformed according to an IP home area of a source site. For example, awebsite in a disturbed area or a foreign website has a relatively highrisk level, and is classified into high-risk websites. The IP home areacan be obtained from a global IP address database. Classification isthen performed according to a type of a website. For example, a websitewith website information not existing in an ICP filing website isclassified into high-risk websites. The website information can beobtained by HTTP message interaction. The information is dynamicallyobtained and updated regularly during an actual retrieval process, andfinally a risk identifier is given to each cached content.

Optionally, website levels may alternatively be identified andclassified by manually adding risk levels.

Optionally, risk levels of the website are divided into five levels,with level 5 being the highest risk level and level 1 being the lowestrisk level.

(2) Classification by popularity: Statistics are collected forpopularity of the cached resources. For example, the cached resourcesare classified into resources with three-day popularity, weeklypopularity, and biweekly popularity. If corresponding duration is notreached for a resource, there is no statistical value for the resource.As a popularity value is updated in real time, a popularity value in thecontent identifier is also updated in real time.

Optionally, popularity values for the cached resources are divided intofive levels, level 5 being the most popular and level 1 being the mostunpopular. A correspondence relationship between a level and a resourceaccess frequency may also be manually configured.

The content identifier storage module 43 is configured to save thecontent identifiers separately. The content identifier is stored in thedisk and stored separately from the cached resource. A format of thecontent identifier is as follows: CP∥domain name of theCP∥column∥time∥website risk level∥cached resource popularity. Forexample, in the following formatcpid=xxvideo∥domain=xx.com∥column=movie∥time=2019/1/2∥filekey=/abc/123/xxx.mp4∥alarm=1∥hotrate=5,cpid represents the CP;

domain represents a domain name of the CP; column represents a column;time represents a time, which is specifically a resource launch time;filekey represents a unique identifier of the cached resource; alarmrepresents a risk level of a source website for the resource; andhotrate represents popularity of the resource. The example contentidentifier represents a cached resource from the xx video supplier, withthe domain name of xx.com, the column of movies, the launch time of Jan.2, 2019, the unique resource identifier of/abc/123/xxx.mp4, the risklevel of 1, and resource popularity of level 5.

The content identifier batch search module 44 is configured to find,through a keyword-based query, content identifiers meeting at least onecondition, and locate paths of cached resources by using the contentidentifiers meeting the at least one condition. After obtaining thekeywords, the content identifier batch search module 44 finds the parts,meeting at least one condition, of the separately stored contentidentifiers through a keyword-based query. It should be understood thata keyword-based query may refer to a query for content identifiersmatching only one specific keyword, or a query based on a plurality ofkeywords combined to obtain content identifiers meeting a combination ofconditions. A storage path of the cached resource can be locatedaccording to partial data of the content identifier. During cachingresources, md5 is calculated by using the content identifier from whichalarm and hotrate parts are removed, and a path of the cached resourceis planned according to an md5 value. The path of the cached resource isplanned according to the md5 value, which ensures uniqueness of the pathof the cached resource, and also enables the content identifier to havea function of obtaining a location of the cached resource.

The content deletion module 45 is configured to delete the locatedcached resources from the file storage module 41 one by one. The contentdeletion module 45 is invoked recursively until all the located cachedresources are deleted. After deleting the located cached resources, thecontent identifiers which correspond to the deleted cached resources inthe content identifier storage module 43 are also deleted.

Optionally, the batch deletion apparatus for cached resources in thisembodiment further includes an outdated content module 46 configured toselect outdated content for deletion.

This embodiment has provided a batch deletion apparatus for cachedresources including the file storage module, the content caching module,the content identifier storage module, the content identifier batchsearch module, and the content deletion module. The content cachingmodule adds the keywords to the content identifiers which correspond tothe cached resources. The content identifier storage module saves thecontent identifiers separately. When needing to delete specified cachedresources, the content identifier batch search module finds the contentidentifiers meeting at least one condition through a keyword-basedquery, and uses the content identifiers meeting the at least onecondition to locate the storage paths of the cached resources. Thecontent deletion module is invoked recursively to delete the locatedcached resources one by one. The batch deletion apparatus for cachedresources is intended to at least solve the following problems to acertain extent: in some cases, the CDN server constructed based on NGINXsupports only a narrow range of content deletion functions and does notsupport timely batch deletion of content with some commoncharacteristics, and consequently, efficiency is extremely low whenbatch deletion is required; and in some cases, if the platform includessensitive or unsafe resources, a server disk has to be formatted andthus all content has to be re-cached, causing a waste of resources. Themethod realizes batch deletion of cached content in the CDN server withcustomized deletion conditions.

Example Embodiment V

This embodiment is intended to at least solve the following problems toa certain extent: in some cases, a CDN server constructed based on NGINXsupports only a narrow range of content deletion functions and does notsupport timely batch deletion of content with some commoncharacteristics, and consequently, efficiency is extremely low whenbatch deletion is required; and in some cases, if a platform includessensitive or unsafe resources, a server disk has to be formatted andthus all content has to be re-cached, causing a waste of resources. Thisembodiment provides a batch deletion device for cached resources, asshown in FIG. 6 , including a processor 61, a memory 62, and acommunication bus 63, where

the communication bus is configured to connect the processor and thememory; and

the processor is configured to execute one or more computer programsstored in the memory to implement at least one step in the batchdeletion method for cached resources in the foregoing example embodimentI, example embodiment II, and example embodiment III.

This embodiment further provides a computer-readable storage medium thatincludes a volatile or non-volatile, removable or non-removable mediumimplemented in any method or technology for storing information, such ascomputer-readable instructions, data structures, computer programmodules, or other data. The computer-readable storage medium includes,but is not limited to, random access memory (RAM), read-only memory(ROM), electrically erasable programmable read-only memory (EEPROM),flash memory or other memory technologies, compact disc read-only memory(CD-ROM), digital versatile disc (DVD) or other optical disc storage,cassettes, magnetic tapes, magnetic disc storage or other magneticstorage devices, or any other media that can be configured to storedesired information and can be accessed by computers.

The computer-readable storage medium in this embodiment may beconfigured to store one or more computer programs executable by one ormore processors to implement at least one step in the batch deletionmethod for cached resources in the foregoing example embodiment I,example embodiment II, and example embodiment III.

This embodiment further provides a computer program (or computersoftware) which may be distributed on a computer-readable medium and maybe executed by a computing device to implement at least one step in thebatch deletion method for cached resources in the foregoing exampleembodiment I, example embodiment II, and example embodiment III. and insome cases, at least one step illustrated or described may be performedin an order different from that described in the above embodiments.

This embodiment further provides a computer program product, including acomputer-readable device which stores any of the computer programs asillustrated above. In this embodiment, the computer-readable device mayinclude the computer-readable storage medium as illustrated above.

The present disclosure has the following beneficial effects:

According to the batch deletion method, apparatus, and device for cachedresources, and a computer-readable storage medium provided in theembodiments of the present disclosure, keywords are added to contentidentifiers of cached content and the content identifiers are savedseparately; when the cached resources need to be deleted, the contentidentifiers meeting at least one condition can be found through akeyword-based query, and storage paths of the corresponding cachedresources can be determined according to the content identifiers; andfinally, the located cached resources are deleted one by one. In someimplementations, technical effects include but are not limited to batchdeletion of cached content in the CDN server with customized deletionconditions.

As can be seen, it should be understood by those having ordinary skillin the art that all or some of the steps in the methods disclosed above,functional modules/units in the systems and devices disclosed above maybe implemented as software (which may be implemented by computer programcode executable by a computing device), firmware, hardware, andappropriate combinations thereof. In the hardware implementation, thedivision between functional modules/units mentioned in the abovedescription does not necessarily correspond to the division of physicalcomponents; for example, a physical component may have multiplefunctions, or a function or step may be performed cooperatively byseveral physical components. Some or all of the physical components maybe implemented as software executed by a processor, such as a centralprocessing unit, a digital signal processor or a microprocessor, or ashardware, or as an integrated circuit, such as an application specificintegrated circuit.

Furthermore, it is well known to those having ordinary skill in the artthat communication media typically contain computer-readableinstructions, data structures, computer program modules or other data ina modulated data signal such as a carrier wave or other transmissionmechanism, and may include any information delivery media. Therefore,the present disclosure is not limited to any particular combination ofhardware and software.

The foregoing is a further detailed description of the embodiments thepresent disclosure in conjunction with particular implementations, andspecific implementations of the present disclosure should not beconstrued as being limited to the description. For those having ordinaryskill in the art to which the present disclosure pertains, withoutdeparting from the concept of the present disclosure, several simpledeductions or substitutions can be made, which should be regarded asfalling within the scope of the present disclosure.

1. A batch deletion method for cached resources, comprising: addingkeywords to content identifiers which correspond to cached resources;saving the content identifiers separately; finding, through akeyword-based query, content identifiers meeting at least one condition;locating storage paths of cached resources by using the contentidentifiers meeting the at least one condition; and deleting the locatedcached resources one by one.
 2. The batch deletion method for cachedresources of claim 1, wherein each content identifier further comprisesa unique identifier of a respective cached resource.
 3. The batchdeletion method for cached resources of claim 1, before finding, througha keyword-based query, content identifiers meeting at least onecondition, the method further comprising obtaining keyword information.4. The batch deletion method for cached resources of claim 1, whereinclassification rules for the content identifiers are divided dependingon the keywords into static classification and dynamic classification.5. The batch deletion method for cached resources of claim 4, whereinthe static classification refers to classification performed accordingto fixed keywords in the content identifiers for the cached resources.6. The batch deletion method for cached resources of claim 4, whereinthe dynamic classification refers to classification performed accordingto dynamically changeable keywords in the content identifiers for thecached resources.
 7. The batch deletion method for cached resources ofclaim 1, after deleting the located cached resources one by one, themethod further comprising deleting content identifiers which correspondto the deleted cached resources.
 8. A batch deletion apparatus forcached resources, comprising: a file storage module configured to storecached resources; a content caching module configured to add keywords tocontent identifiers which correspond to the cached resources; a contentidentifier storage module configured to save the content identifiersseparately; a content identifier batch search module configured to find,through a keyword-based query, content identifiers meeting at least onecondition, and locate paths of cached resources by using the contentidentifiers meeting the at least one condition; and a content deletionmodule configured to delete the located cached resources one by one. 9.A batch deletion device for cached resources, comprising a processor, amemory, and a communication bus, wherein: the communication bus isconfigured to connect a first processor and a first memory; and theprocessor is configured to execute at least one computer program storedin the memory to implement the batch deletion method for cachedresources comprising: adding keywords to content identifiers whichcorrespond to cached resources; saving the content identifiersseparately; finding, through a keyword-based query, content identifiersmeeting at least one condition; locating storage paths of cachedresources by using the content identifiers meeting the at least onecondition; and deleting the located cached resources one by one.
 10. Anon-transitory computer-readable storage medium storing at least onecomputer program, wherein the at least one computer program isexecutable by at least one processor to implement the batch deletionmethod for cached resources of claim
 1. 11. The batch deletion methodfor cached resources of claim 2, wherein classification rules for thecontent identifiers are divided depending on the keywords into staticclassification and dynamic classification.
 12. The batch deletion methodfor cached resources of claim 3, wherein classification rules for thecontent identifiers are divided depending on the keywords into staticclassification and dynamic classification.
 13. A non-transitorycomputer-readable storage medium storing at least one computer program,wherein the at least one computer program is executable by at least oneprocessor to implement the batch deletion method for cached resources ofclaim
 2. 14. A non-transitory computer-readable storage medium storingat least one computer program, wherein the at least one computer programis executable by at least one processor to implement the batch deletionmethod for cached resources of claim
 3. 15. A non-transitorycomputer-readable storage medium storing at least one computer program,wherein the at least one computer program is executable by at least oneprocessor to implement the batch deletion method for cached resources ofclaim
 4. 16. A non-transitory computer-readable storage medium storingat least one computer program, wherein the at least one computer programis executable by at least one processor to implement the batch deletionmethod for cached resources of claim
 5. 17. A non-transitorycomputer-readable storage medium storing at least one computer program,wherein the at least one computer program is executable by at least oneprocessor to implement the batch deletion method for cached resources ofclaim
 6. 18. A non-transitory computer-readable storage medium storingat least one computer program, wherein the at least one computer programis executable by at least one processor to implement the batch deletionmethod for cached resources of claim 7.